import Vue from 'vue'
import Router from 'vue-router'
import Main from "../views/Main";
import Login from "../views/Login";
import Department from "../views/user/Department";
import UserProfile from "../views/user/Profile";
import NotFound from "../views/404"
import Register from "../views/Register";
import UserList from "../views/user/UserList";
import VideoList from "../views/video/VideoList";

Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [
    {
      path: "/main",
      name: 'Main',
      // path: "/main/:username",
      // props: true,
      redirect: '/WelCome',
      component: Main,
      children: [
        {
          path: '/WelCome',
          name:'WelCome',
          props: true,
          component: UserProfile
        },
        {
          path: '/user/department',
          component: Department
        },
        {
          path: '/user/userlist',
          component: UserList
        },
        {
          path: '/video/videolist',
          component: VideoList
        }
      ]
    },
    {
      path: "/",
      name: 'Login',
      component: Login
    },
    {
      path: "/register",
      component: Register
    },
    {
      path: '/goHome',
      redirect: '/'
    },
    {
      path: '*',
      component: NotFound
    }
  ]
})

